<!DOCTYPE html>
<html lang="zh-CN" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layout/default" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>注册管理</title>
    <meta charset="UTF-8">
    <script th:src="@{/assets/scripts/register.js}"></script>
    <link th:href="@{/assets/css/register.css}" rel="stylesheet" type="text/css"/>
    <!--[if lt IE 10]>
    <link th:href="@{/assets/css/ie.css}" rel="stylesheet" type="text/css"/>
    <![endif]-->
    <script>
        $(document).ready(function () {
            register.init();
            register.sendEmail();
            register.selectDataByKey();
        });

        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            if (n == null || n == "") {
                $(".real-key").val($(".show-key").val());
            }
            if ($("#keyInput").val() == '请输入搜索条件...') {
                $("[name='queryKeyWord']").val('');
            }
            $("#registerSearchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<div layout:fragment="content" th:remove="tag">
    <div th:replace="fragments/tool :: tipMessage (type='',content=${message})" th:remove="tag"></div>
    <div th:replace="fragments/toolEmail :: emailMessage (type='',content=${risMessage})" th:remove="tag"></div>
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a th:href="@{/}">首页</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">配置管理</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li><a href="#">注册管理</a></li>
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->
        </div>
    </div>

    <div class="row profile">
        <div class="col-md-12">
            <!--BEGIN TABS-->
            <div class="tabbable tabbable-custom tabbable-full-width">
                <div class="tab-content">
                    <div class="tab-pane active" id="user_tab_1_1">
                        <div class="row search-form-default alert alert-info">
                            <form id="registerSearchForm" method="post" class="form-inline"
                                  th:action="@{/registerManage/registerInfo}" th:object="${page}">
                                <input id="pageNo" name="pageNo" type="hidden" th:value="*{pageNo}"/>
                                <input id="pageSize" name="pageSize" type="hidden" th:value="*{pageSize}"/>
                                <input id="orderBy" name="orderBy" type="hidden" th:value="*{orderBy}"/>

                                <!-- <div class="form-group form-group-org">
                                     <div th:replace="fragments/tool :: treeSelect (id='company',name='company.id', labelName='organization',nameVal='', labelVal=${organization}, cssClass='required', placeholder='', dialogTitle='公司', remoteUrl='/sys/office/treeData?type=1', always=true)"></div>
                                 </div>-->
                                <div class="col-md-5 form-group-select">
                                    <div class="input-group input-xlarge">
                                        <!-- /btn-group -->
                                        <input type="text" th:value="${queryKeyWord}" class="form-control show-key"
                                               maxlength="50" placeholder="请输入搜索条件..." id="keyInput"/>
                                        <input type="hidden" class="form-control real-key"
                                               th:value="${queryKeyWord}" name="queryKeyWord" maxlength="50"/>

                                        <div class="input-group-btn" shiro:has-permission="sys:register:view">
                                            <button type="button" class="btn green" onclick="return page();"
                                                    id="searchBt">
                                                搜索 &nbsp;<i class="m-icon-swapright m-icon-white"></i>
                                            </button>
                                        </div>
                                        <!-- /btn-group -->
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="row">
                            <div class="form-group-nav">
                                <div class="form-group form-group-w ">
                                    <label class="control-label form-text alert-info">
                                        <label class="top-count-size">
                                            <th:block th:text="${activateUser}"></th:block>
                                        </label>
                                        <br>
                                        已绑定账号数
                                    </label>
                                </div>
                                <div class="form-group  form-group-w ">
                                    <label class="control-label form-text alert-info">
                                        <label class="top-count-size">
                                            <th:block th:text="${notActivateUser}"></th:block>
                                        </label>
                                        <br>
                                        未绑定账号数</label>
                                </div>
                                <div class="form-group form-group-w ">
                                    <label class="control-label form-text alert-info">
                                        <label class="top-count-size">
                                            <th:block th:text="${userCount}"></th:block>
                                        </label>
                                        <br>
                                        累计账号总数</label>
                                </div>
                            </div>
                        </div>
                        <div class="table-responsive">
                            <form id="sendForm" method="post" class="form-inline"
                                  th:action="@{/registerManage/sendEmail}">
                                <table class="table table-striped table-bordered table-advance table-hover table-ie"
                                       id="sample_1">
                                    <thead>
                                    <tr>
                                        <th class="table-checkbox td-minw-1 th-ie"
                                            shiro:has-permission="sys:register:edit">
                                            <input type="checkbox" class="group-checkable"
                                                   data-set="#sample_1 .checkboxes"/>&nbsp全选
                                            <input type="hidden" name="queryKeyWord" th:value="${queryKeyWord}"/>
                                            <input type="hidden" name="organization" id="organization"/>
                                        </th>
                                        <th class="td-minw-2 th-ie">序列</th>
                                        <th class="td-minw-3">真实姓名</th>
                                        <th class="td-minw-4">账号</th>
                                        <th class="td-minw-5">常用邮箱</th>
                                        <th class="td-minw-6">所属机构</th>
                                        <th class="td-minw-7">角色</th>
                                        <th class="td-minw-8">账号状态</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr th:each="user , stat : ${page.list}">
                                        <td shiro:has-permission="sys:register:edit">
                                            <input th:name="ids" th:if="${user.state} != 2 "
                                                   class="checkboxes"
                                                   th:value="${user.id}"
                                                   type="checkbox">
                                        </td>
                                        <td th:text="(${page.pageNo} - 1) * ${page.pageSize} + 1 + ${stat.index}">1</td>
                                        <td class="text-leave-out max-real-name" th:text="${user.realName}"
                                            th:title="${user.realName}">name
                                        </td>
                                        <td class="text-leave-out max-real-name" th:text="${user.loginName}"
                                            th:title="${user.loginName}">username
                                        </td>
                                        <td class="text-leave-out max-real-name" th:text="${user.email}"
                                            th:title="${user.email}">email
                                        </td>
                                        <td class="text-leave-out max-real-name" th:text="${user.company.name}"
                                            th:title="${user.company.name}">
                                            novunda
                                        </td>
                                        <td class="text-leave-out max-real-name" th:text="${user.roleNames}"
                                            th:title="${user.roleNames}">roleNames
                                        </td>
                                        <td>
                                            <th:block
                                                    th:text="${user.bindStatus} == 0 ? '未绑定' : '已绑定' ">
                                                未发送
                                            </th:block>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </form>
                        </div>
                        <div class="row margin-top-20">
                            <th:block th:utext="${page}"/>
                        </div>
                        <div class="form-actions fluid">
                            <div class="col-md-offset-my col-md-4">
                                <button type="button" class="btn blue" id="sendEmailBt"
                                        shiro:has-permission="sys:register:edit">发 送
                                </button>
                                <form id="sendFormA" method="post" class="form-inline"
                                      th:action="@{/registerManage/sendEmail}">
                                    <th:block th:each="user , stat : ${ids}">
                                        <input name="ids" th:value="${user}" type="hidden">
                                    </th:block>
                                    <input type="hidden" name="queryKeyWord" th:value="${queryKeyWord}"/>
                                    <input type="hidden" name="organization" id="organizationA"/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>
